package models

import (
	"time"
	"github.com/astaxie/beego/orm"
)

type GlobalConfig struct {
	Id int `orm:"size(11)"`
	GlobalChroot string `orm:"size(50)"`
	GlobalLog string `orm:"size(50)"`
	GlobalMaxconn string `orm:"size(5)"`
	GlobalNbproc string `orm:"size(2)"`
	GlobalUser string `orm:"size(10)"`
	GlobalGroup string `orm:"size(10)"`
	GlobalDaemon string `orm:"size(1)"`
	GlobalPidfile string `orm:"size(50)"`
	DefaultMod string `orm:"size(5)"`
	DefaultRetries string `orm:"size(1)"`
	DefaultConnectTimeout string `orm:"size(5)"`
	DefaultClientTimeout string `orm:"size(5)"`
	DefaultServerTimeout string `orm:"size(5)"`
	DefaultCheckTimeout string `orm:"size(5)"`
	CreateAt time.Time `orm:"auto_now_add;type(datetime)"`
}

type Maps struct {
	Id int `orm:"size(11)"`
	MapName string `orm:"size(100)"`
	MapType string `orm:"size(10)"`
	MapPort string `orm:"size(5)"`
	MapTargetId string `orm:"size(100)"`
	CreateAt time.Time `orm:"auto_now_add;type(datetime)"`
}

type Targets struct {
	Id int `orm:"size(11)"`
	TargetName string `orm:"size(100)"`
	TargetService string `orm:"size(100)"`
	TargetWeight string `orm:"size(5)"`
	CreateAt time.Time `orm:"auto_now_add;type(datetime)"`
}

type Nodes struct {
	Id int `orm:"size(11)"`
	Name string `orm:"size(50)"`
	ClusterListnerAddress string `orm:"size(100)"`
	CreateAt time.Time `orm:"auto_now_add;type(datetime)"`
}

func init() {
	orm.RegisterModel(new(GlobalConfig), new(Maps), new(Targets), new(Nodes))
}

